/*
 * @Author: 李天惊 uf_lee@163.com
 * @Date: 2022-08-15 16:45:25
 * @LastEditors: 李天惊 uf_lee@163.com
 * @LastEditTime: 2022-08-24 17:03:48
 * @FilePath: \ahbs\uc_sys\src\api\uc\menu\index.ts
 * Copyright (c) 2022 by 李天惊 uf_lee@163.com, All Rights Reserved.
 */
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 菜单列表
export const ucMenuListApi = (data: any) => {
  const token: string = wsCache.get('token')
  return request.post({
    url: 'index.php/api/common',
    headers: { token: token },
    data: {
      code: 'ucMenuList',
      data: data
    }
  })
}

// 菜单新增
export const ucMenuAddApi = (data: any) => {
  const token: string = wsCache.get('token')
  return request.post({
    url: 'index.php/api/common',
    headers: { token: token },
    data: {
      code: 'ucMenuAdd',
      data: data
    }
  })
}

// 菜单修改
export const ucMenuEditApi = (data: any) => {
  const token: string = wsCache.get('token')
  return request.post({
    url: 'index.php/api/common',
    headers: { token: token },
    data: {
      code: 'ucMenuEdit',
      data: data
    }
  })
}

// 菜单删除
export const ucMenuDelApi = (data: any) => {
  const token: string = wsCache.get('token')
  return request.post({
    url: 'index.php/api/common',
    headers: { token: token },
    data: {
      code: 'ucMenuDel',
      data: data
    }
  })
}
